home *** CD-ROM | disk | FTP | other *** search
- Path: news.Stanford.EDU!not-for-mail
- From: brien@leland.Stanford.EDU (brien oberstein)
- Newsgroups: comp.lang.c++
- Subject: Re: Copy constructing an already default constructed object
- Date: 27 Jan 1996 10:23:17 -0800
- Organization: Stanford University
- Message-ID: <4edqil$7ub@elaine11.Stanford.EDU>
- References: <4e906b$stk@elaine32.Stanford.EDU> <4eaosg$ab7@news.bridge.net>
- NNTP-Posting-Host: elaine11.stanford.edu
- X-Newsreader: NN version 6.5.0 (NOV)
-
- David Byrden <100101.2547@compuserve.com> writes:
-
-
- >>> I'd like to know what people think of the solution I've reached.
-
- >No offence, but you genuinely do not know what you are doing. I recommend
- >some serious study of worked examples of C++.
-
- Thanks Dave. I value your opinion.
-
-
- >For example, you should never use memcpy to copy C++ objects. There are
- >many reasons.
-
- Ok. Name one besides the vtable pointer. Put up or shut up.
-
-
- >I simply can't understand why it is that you won't write an assignment
- >operator like this;
-
- >A& operator=( const A&* other )
- >{
- > return if assigning self to self
- > do what the dtor does
- > do what the copy ctor does
- > return *this
- >}
-
- Can you say "duplicating code" all over the place.
- And the real problem is that I've got objects
- within objects which need to be initialized in the
- ctor initialization list so I can't share a single
- function.
-
- >This is the basic model for an assignment operator, although it usually
- >can be internally optimised
-
-
- >>> I figure that this type of shit is common enough
- >C++ is not the only language where you need improvements.
-
- Thanks again. Next time I'll post my mother fuckin article
- to comp.lang.english first and see if everyone approves.
-
- dickhead.
-
- -brien
-
-